import request from '@/utils/request'

/**
 * 获取订单预览信息
 * @returns {Promise}
 */
export const getOrderPreApi = () => {
  return request.get('/member/order/pre')
}

/**
 * 提交订单
 * @param {Object} data 订单信息
 * @returns {Promise}
 */
export const submitOrderApi = (data) => {
  return request({
    url: '/member/order',
    method: 'post',
    data,
  })
}

/*
params: {
	orderState:0,
  page:1,
  pageSize:2
}
*/
/**
 * 获取用户订单列表
 * @param {Object} params 查询参数
 * @returns {Promise}
 */
export const getUserOrder = (params) => {
  return request({
    url: '/member/order',
    method: 'GET',
    params,
  })
}
